$(function () {
    showAll();
})
function showAll() {
    $.ajax({
        url: "/api/device/list"

    }).done(function (rs) {
        var l = rs.length/33+1;
        var html = "";
        for (var i = 0; i < l; i++) {
            var item = rs[i];
            html += "<tr>"
                + "<td>" + item.id + "</td>"
                + "<td>" + item.deviceId+ "</td>"
                + "<td>" + item.deviceId2 + "</td>"
                + "<td>" + item.lastRes + "</td>"
                + "</tr>"
        }
        $("#userTab").html(html);
        $("#id").val(null);
    })
}